﻿using BussinessObject.ObjectTwo;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ProjectHK3.App_Code;
namespace ProjectHK3.Object_One
{
    public partial class ChangePasswordForAmin : System.Web.UI.Page
    {
        B_GetAccount ex = new B_GetAccount();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Label2.Text = Session["name"].ToString();
            }
        }
        public void update()
        {
            if (ex.ChangePass(int.Parse(Session["Account_id"].ToString()), TextBox2.Text.ToString()) == true)
            {
                Alert.Show("Change Password Sucessful!!");
            }
            else
            {
                Alert.Show("Change Password Fail. Please try again");
            }
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            update();
        }

        protected void Button2_Click(object sender, EventArgs e)
        {
            TextBox2.Text = "";
            TextBox3.Text = "";
            TextBox2.Focus();
        }

        protected void Button3_Click(object sender, EventArgs e)
        {
            Response.Redirect("../Object One/EmpoyeeDetail.aspx");
        }
    }
}